/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.farmcode.base.web;

/**
 *
 * @author oiprado
 */
public abstract class BaseLookUp <E> extends BaseBacking  {
  
  public static final String LOOKUP_NEW_ENTITY = "";
  public static final String LOOKUP_FILTER_ENTITY = "";
  protected LookUpCallBack<E> lookUpCallBack;
  
  public void onSelectRow(E entity){
    
    if(getLookUpCallBack() != null){
      lookUpCallBack = (LookUpCallBack<E>) getLookUpCallBack();
      lookUpCallBack.selected(entity);
    }
    close();
  }
  
  public void close(){
    getSession().setValue(GLOBAL_LOOK_UP, "none");
  }

}
